package persistence.dataAccessObjects.interfaces;

import java.util.ArrayList;
import java.util.HashMap;

import javax.servlet.ServletException;

import persistence.dataAccessObjects.ShoppingHistoryType;
import persistence.transferPOJOs.Auktion;
import persistence.transferPOJOs.Gebot;
import persistence.transferPOJOs.Sofortkauf;
import persistence.transferPOJOs.SofortkaufAngebot;
import persistence.transferPOJOs.User;
import persistence.transferPOJOs.produkte.Produkt;
import exceptions.DatasetNotFoundException;

public interface IAuktionsDAO {

	public boolean insertAuktion(Auktion auktion) throws ServletException;

	public boolean insertGebot(Gebot gebot) throws ServletException;

	public Auktion getAuktionByID(int ID) throws ServletException,
			DatasetNotFoundException;

	public boolean insertSofortkauf(Sofortkauf sofortkauf)
			throws ServletException;

	public boolean insertSofortkaufAngebot(SofortkaufAngebot ska)
			throws ServletException;
	
	public boolean changeAuktionData(Auktion auktion) throws ServletException,
	DatasetNotFoundException;
	
	public boolean changeSofortkaufData(Sofortkauf sk) throws ServletException,
	DatasetNotFoundException;
	
	public boolean changeSofortkaufMenge(int SKID, int menge)
			throws ServletException, DatasetNotFoundException;
	
	public boolean changeSofortkaufAngebotData(SofortkaufAngebot ska)
			throws ServletException, DatasetNotFoundException;
	
	public SofortkaufAngebot getSofortkaufAngebotByID(int SKAID)
			throws ServletException, DatasetNotFoundException;
	
	public Auktion getAuktionByProductID(int PID) throws ServletException,
	DatasetNotFoundException;
	
	public SofortkaufAngebot getImmediatePurchaseByProductID(int PID)
			throws ServletException, DatasetNotFoundException;
	
	public boolean deleteAuktion(int id) throws DatasetNotFoundException,
	ServletException;
	
	public double getHighestBiddingByProductID(int productID)
			throws DatasetNotFoundException, ServletException;
	
	public double getHighestBiddingByAuctionID(int auctionID)
			throws ServletException;
	
	public String getHighestBiddingUserByProductID(int productID)
			throws DatasetNotFoundException, ServletException;
	
	public boolean deleteGebot(int gebotID) throws ServletException;
	
	public boolean deleteSofortkauf(int SKID) throws ServletException ;
	
	public boolean deleteSofortkaufAngebot(int SKAID) throws ServletException;
	
	public HashMap<Produkt, Gebot> getOrderedAuctions(String userEmail,
			ShoppingHistoryType shoppingHistoryType) throws ServletException,
			DatasetNotFoundException;
	
	public HashMap<Produkt, Sofortkauf> getOrderedImmediatePurchases(
			String userEmail, ShoppingHistoryType shoppingHistoryType)
			throws ServletException, DatasetNotFoundException;
	
	public ArrayList<Auktion> getRunningAuctionsByUserID(String userEmail)
			throws ServletException;
	
	public int getImmediatePurchaseSaleNumber(int SKAID)
			throws ServletException;
	
	public boolean payOrder(String userEmail) throws ServletException,
	DatasetNotFoundException;
}
